<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Excel文件比较工具</title>
    <link rel="stylesheet" href="styles.css">
    <script src="https://unpkg.com/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script>
        // 检查xlsx库是否加载成功
        if (typeof XLSX === 'undefined') {
            // 尝试从本地加载
            const localScript = document.createElement('script');
            localScript.src = 'xlsx.full.min.js';
            localScript.onerror = () => {
                document.addEventListener('DOMContentLoaded', () => {
                    document.getElementById('result').innerHTML = 
                        '<p style="color:red">错误：未能加载xlsx库，请检查网络或下载库文件到本地</p>';
                });
            };
            document.head.appendChild(localScript);
        }
    </script>
</head>
<body>
    <div class="container">
        <h1>Excel文件比较工具</h1>
        <div class="upload-section">
            <input type="file" id="file1" accept=".xlsx, .xls">
            <input type="file" id="file2" accept=".xlsx, .xls">
            <button id="compare">比较文件</button>
        </div>
        <div id="result"></div>
    </div>
    <script src="script.js"></script>
</body>
</html>